//     https://ac.nowcoder.com/acm/contest/11214/A



#include <iostream>
using namespace std;

typedef long long LL;

int main()
{
    LL a, b, h, k, sum, t1 = 0, t2 = 0;
    cin >> a >> h >> b >> k;
    t1 = h / b;
    t2 = k / a;

    if (h % b)  t1++;
    if (k % a)  t2++;

    sum = min(t1, t2) * (a + b);
    if (t1 < t2)  sum += b * 10;
    if (t1 > t2)  sum += a * 10;

    cout << sum;
    return 0;
}